namespace MetaView.Core;

/// <summary>
/// 消息包
/// </summary>
public class MsgPackage : PackageBase
{
    /// <summary>
    /// 消息
    /// </summary>
    public string Message { get; set; }

    /// <inheritdoc/>
    public override void Package<TByteBlock>(ref TByteBlock byteBlock)
    {
        byteBlock.WriteString(this.Message, FixedHeaderType.Ushort);
    }

    /// <inheritdoc/>
    public override void Unpackage<TByteBlock>(ref TByteBlock byteBlock)
    {
        this.Message = byteBlock.ReadString(FixedHeaderType.Ushort);
    }
}